#ifndef Line_h
#define Line_h
#include <opencv/cv.h>
#include <vector>

#include "Intersection.h"

class Line
{
	cv::Point _p1;
	cv::Point _p2;
	char _orientation;

	std::vector<Intersection> intsecs;

public:
	int id;
	cv::Mat dirVec;
	Line(cv::Point, cv::Point);
	Line(cv::Point, cv::Point, int);
	Line();
	~Line(void);
	
	double getAngle();
	void createDirVec();

	Line extendLine(int, int);
	cv::Point findIntersection(Line);
	std::vector<cv::Point> getPoints();
	void drawLine(cv::Mat);
	void drawLine(cv::Mat, cv::Scalar);
	void printLine();
	char determineOrientation();
	char getOrientation();
	bool isHorizontal();
	bool isVertical();
	double getLength();

	cv::Vec<int, 3> getVec();

	void addIntersection(Intersection);
	void reFitLine();
	void reFitHorizontalLine();
	void reFitVerticalLine();
	std::vector<Intersection> getIntersectionPts();
};

#endif